commonlibsse_ng\re\t/
TESObject.rs

1use core::ffi::{c_uint, c_void};
2
3use crate::{
4    re::{TESForm::TESForm, offsets_rtti::RTTI_TESObject, offsets_vtable::VTABLE_TESObject},
5    rel::id::VariantID,
6};
7
8#[repr(C)]
9#[derive(Debug)]
10pub struct TESObject {
11    pub __base: TESForm,
12}
13const _: () = assert!(core::mem::size_of::<TESObject>() == 0x20);
14
15#[repr(C)]
16pub struct TESObjectVtbl {
17    // TESForm vtable entries
18    pub destructor: unsafe extern "C" fn(this: *mut TESObject),
19    pub IsObject: unsafe extern "C" fn(this: *const TESObject) -> bool,
20    pub GetRefCount: unsafe extern "C" fn(this: *const TESObject) -> c_uint,
21
22    // TESObject-specific methods
23    pub Unk_3B: unsafe extern "C" fn(this: *mut TESObject),
24    pub IsBoundAnimObject: unsafe extern "C" fn(this: *mut TESObject) -> bool,
25    pub GetWaterType: unsafe extern "C" fn(this: *const TESObject) -> *mut c_void,
26    pub IsAutoCalc: unsafe extern "C" fn(this: *const TESObject) -> bool,
27    pub SetAutoCalc: unsafe extern "C" fn(this: *mut TESObject, auto_calc: bool),
28    pub Clone3D:
29        unsafe extern "C" fn(this: *mut TESObject, ref_: *mut c_void, arg3: bool) -> *mut c_void,
30    pub UnClone3D: unsafe extern "C" fn(this: *mut TESObject, ref_: *mut c_void),
31    pub IsMarker: unsafe extern "C" fn(this: *mut TESObject) -> bool,
32    pub IsOcclusionMarker: unsafe extern "C" fn(this: *mut TESObject) -> bool,
33    pub ReplaceModel: unsafe extern "C" fn(this: *mut TESObject) -> bool,
34    pub IncRef: unsafe extern "C" fn(this: *mut TESObject) -> c_uint,
35    pub DecRef: unsafe extern "C" fn(this: *mut TESObject) -> c_uint,
36    pub LoadGraphics: unsafe extern "C" fn(this: *mut TESObject, ref_: *mut c_void) -> *mut c_void,
37}
38
39impl TESObject {
40    pub const RTTI: VariantID = RTTI_TESObject;
41    pub const VTABLE: [VariantID; 1] = VTABLE_TESObject;
42}
43
44#[repr(u32)]
45#[derive(Debug, Clone, Copy)]
46pub enum ChangeFlags {
47    ObjectValue = 1 << 1,
48    ObjectFullName = 1 << 2,
49}